/**
 * Copyright 2016-2018 mobaas.com
 */
package com.mobaas.devops.dao.mybatis;

import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.mobaas.devops.dao.ContainerDao;
import com.mobaas.devops.model.Container;
import com.mobaas.devops.model.ContainerStat;

/**
 * 
 * @author billy zhang
 * 
 */
@Mapper
public interface ContainerMapper extends ContainerDao {

	@Override
	int updateContainer(Container cont);

	@Override
	void insertContainer(Container cont);

	@Override
	Container selectContainerById(
			@Param("containerId")String containerId);

	@Override
	Container selectContainerByHostAndPort(
			@Param("hostIp")String hostIp, 
			@Param("port")int port);
	
	@Override
	void insertContainerStat(ContainerStat stat);
	
	@Override
	List<ContainerStat> selectContainerStatsTotalByApp(
			@Param("appId")String appId, 
			@Param("start")Date startDate,
			@Param("interval")int interval);

	@Override
	List<ContainerStat> selectContainerStatsTotalByHostIp(
			@Param("hostIp")String hostIp, 
			@Param("start")Date startDate);
}
